package moodish.comm;


import java.io.Serializable;
public class ClientSide implements ClientSideMessage, Serializable {

	
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String nick_name;
	private Type type;
	private String payload;

	public ClientSide(String nick, String payload, Type type) {
		nick_name = nick;
		this.type = type;
		this.payload = payload;
	}

	@Override
	public Type getType() {
		return type;
	}

	@Override
	public String getSendersNickname() {
		if (type.equals(Type.MOODISH_MESSAGE))
			return nick_name;
		return ClientSideMessage.SERVER;
	}

	@Override
	public String getPayload() {
		return payload;
	}

}
